<%
	boolean logged = request.getSession().getAttribute("username") != null;
	
	String contextPath = getServletContext().getContextPath();
%>
<header>
	<div id="menu">
		 <ul id="menu_list">
			<li><a href="<%= contextPath %>/index.jsp">Accueil</a></li>
			<li><a href="<%= contextPath %>/showCategory">Categories</a></li>
			<% if(logged){ 
				boolean admin = (Integer)request.getSession().getAttribute("admin") == 1; %>
			<li><a href="<%= contextPath %>/auth/addProject">Creer un Projet</a></li>
			<li><a href="<%= contextPath %>/auth/showProfil">Mon Compte</a></li>
			<% if(admin){ %>
			<li><a href="<%= contextPath %>/admin/backOffice">Administration</a></li>
			<% } %>
			<li><a href="<%= contextPath %>/logout">Deconnexion</a></li>
			<% } else { %>
			<li><a href="<%= contextPath %>/login">Connexion</a></li>
			<li><a href="<%= contextPath %>/register">S'enregistrer</a></li>
			<% } %>
			
		</ul>
	</div>
	<h1>Crowdfunding</h1>
</header>
